package com.alax.interfaces.domain;

import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.alax.common.annotation.Excel;
import com.alax.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * API调用日志对象 api_call_log
 * 
 * @author alax
 * @date 2024-04-03
 */
public class ApiCallLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** API ID */
    @Excel(name = "API ID")
    private Long apiId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** API密钥 */
    @Excel(name = "API密钥")
    private String apiKey;

    /** 请求IP */
    @Excel(name = "请求IP")
    private String ip;

    /** 请求方法 */
    @Excel(name = "请求方法")
    private String requestMethod;

    /** 请求URL */
    @Excel(name = "请求URL")
    private String requestUrl;

    /** 调用状态（0失败 1成功） */
    @Excel(name = "调用状态", readConverterExp = "0=失败,1=成功")
    private Integer status;

    /** 错误信息 */
    @Excel(name = "错误信息")
    private String errorMsg;

    /** 请求参数 */
    @Excel(name = "请求参数")
    private String requestParams;

    /** 响应时间(ms) */
    @Excel(name = "响应时间(ms)")
    private Long responseTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setApiId(Long apiId) 
    {
        this.apiId = apiId;
    }

    public Long getApiId() 
    {
        return apiId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setApiKey(String apiKey) 
    {
        this.apiKey = apiKey;
    }

    public String getApiKey() 
    {
        return apiKey;
    }

    public void setIp(String ip) 
    {
        this.ip = ip;
    }

    public String getIp() 
    {
        return ip;
    }

    public void setRequestMethod(String requestMethod) 
    {
        this.requestMethod = requestMethod;
    }

    public String getRequestMethod() 
    {
        return requestMethod;
    }

    public void setRequestUrl(String requestUrl) 
    {
        this.requestUrl = requestUrl;
    }

    public String getRequestUrl() 
    {
        return requestUrl;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    public void setErrorMsg(String errorMsg) 
    {
        this.errorMsg = errorMsg;
    }

    public String getErrorMsg() 
    {
        return errorMsg;
    }

    public void setRequestParams(String requestParams) 
    {
        this.requestParams = requestParams;
    }

    public String getRequestParams() 
    {
        return requestParams;
    }

    public void setResponseTime(Long responseTime) 
    {
        this.responseTime = responseTime;
    }

    public Long getResponseTime() 
    {
        return responseTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("apiId", getApiId())
            .append("userId", getUserId())
            .append("apiKey", getApiKey())
            .append("ip", getIp())
            .append("status", getStatus())
            .append("errorMsg", getErrorMsg())
            .append("requestParams", getRequestParams())
            .append("responseTime", getResponseTime())
            .append("createTime", getCreateTime())
            .toString();
    }
}
